package pe.gob.onpe.ejb;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import pe.gob.onpe.ejb.id.ParametroCedulaId;


/**
 * ParametroCedula entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "PARAMETRO_CEDULA", schema = "SVENP", uniqueConstraints = {})
public class ParametroCedula implements java.io.Serializable {

	// Fields
	private static final long serialVersionUID = 8426113673110037290L;
	private ParametroCedulaId id;
	private ProcesoElectoral procesoElectoral;
	private Parametro parametro;
	private Long valor;

	// Constructors

	/** default constructor */
	public ParametroCedula() {
	}

	/** full constructor */
	public ParametroCedula(ParametroCedulaId id,
			ProcesoElectoral procesoElectoral, Parametro parametro, Long valor) {
		this.id = id;
		this.procesoElectoral = procesoElectoral;
		this.parametro = parametro;
		this.valor = valor;
	}

	// Property accessors
	@EmbeddedId
	@AttributeOverrides( {
			@AttributeOverride(name = "parametroId", column = @Column(name = "PARAMETRO_ID", unique = false, nullable = false, insertable = true, updatable = true, precision = 10, scale = 0)),
			@AttributeOverride(name = "procesoElectoralId", column = @Column(name = "PROCESO_ELECTORAL_ID", unique = false, nullable = false, insertable = true, updatable = true, precision = 10, scale = 0)) })
	public ParametroCedulaId getId() {
		return this.id;
	}

	public void setId(ParametroCedulaId id) {
		this.id = id;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "PROCESO_ELECTORAL_ID", unique = false, nullable = false, insertable = false, updatable = false)
	public ProcesoElectoral getProcesoElectoral() {
		return this.procesoElectoral;
	}

	public void setProcesoElectoral(ProcesoElectoral procesoElectoral) {
		this.procesoElectoral = procesoElectoral;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "PARAMETRO_ID", unique = false, nullable = false, insertable = false, updatable = false)
	public Parametro getParametro() {
		return this.parametro;
	}

	public void setParametro(Parametro parametro) {
		this.parametro = parametro;
	}

	@Column(name = "VALOR", unique = false, nullable = false, insertable = true, updatable = true, precision = 10, scale = 0)
	public Long getValor() {
		return this.valor;
	}

	public void setValor(Long valor) {
		this.valor = valor;
	}

}